﻿
using ICSharpCode.WinFormsUI.Docking;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DevelopAssistant.Core.Contents
{
    public partial class HomeContent : DockContent
    {
        public HomeContent()
        {
            InitializeComponent();
        }

        private void HomeContent_Load(object sender, EventArgs e)
        {
            this.nScrollingText1.Text = "欢迎使用凌云开发助手，自2016年4月发布正式1.0版以来经历了4个重大版本的升级，详细见开源地址：https://gitee.com/sqlorm/DevelopAssistant。BY 凌云工作室 QQ 270885204";
            //this.nScrollingText1.Text += this.nScrollingText1.Text;
            this.nScrollingText1.ScrollText = this.nScrollingText1.Text;
            this.nScrollingText1.StopScrollOnMouseOver = true;
            this.ScrollingTextBox.Visible = false;

            System.Threading.Tasks.Task.Run(() => {
                System.Threading.Thread.Sleep(2000);
                this.ScrollingTextBox.Invoke(new MethodInvoker(delegate()
                {
                    this.ScrollingTextBox.Visible = true;
                    this.nScrollingText1.Visible = true;                
                }));            
            });

        }

        private void nScrollingText1_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("explorer.exe", "https://gitee.com/sqlorm/DevelopAssistant");
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {
            this.nScrollingText1.Visible = false;
            this.ScrollingTextBox.Controls.Remove(nScrollingText1);
            this.nScrollingText1.Dispose();
            this.Controls.Remove(ScrollingTextBox);
        }
    }
}
